import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
export default new Router({
    routes: [
        // { path: '/', component: resolve => require(['../components/common/Home.vue'], resolve) },
        { path: '/', redirect: '/boss' },
        { path: '/login', component: resolve => require(['../components/page/Login.vue'], resolve) },
        {
            path: '/boss',
            redirect: '/adminList',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '总部菜单' },
            children: [
                {
                    path: '/banner',
                    component: resolve => require(['../views/banner/list.vue'], resolve),
                    meta: { title: '轮播图列表' }
                },
                {
                    path: '/banner/add',
                    component: resolve => require(['../views/banner/add.vue'], resolve),
                    meta: { title: '新增轮播图' }
                },
                {
                    path: '/guide',
                    component: resolve => require(['../views/guide/list.vue'], resolve),
                    meta: { title: '操作指南列表' }
                },
                {
                    path: '/guide/EditCn',
                    component: resolve => require(['../views/guide/EditCn.vue'], resolve),
                    meta: { title: '修改中文操作指南' }
                },
                {
                    path: '/guide/EditEn',
                    component: resolve => require(['../views/guide/EditEn.vue'], resolve),
                    meta: { title: '修改英文操作指南' }
                },
                {
                    path: '/message',
                    component: resolve => require(['../views/message/list.vue'], resolve),
                    meta: { title: '首页消息列表' }
                },
                {
                    path: '/message/add',
                    component: resolve => require(['../views/message/add.vue'], resolve),
                    meta: { title: '新增首页消息' }
                },
                {
                    path: '/message/edit',
                    component: resolve => require(['../views/message/edit.vue'], resolve),
                    meta: { title: '编辑首页消息' }
                },
                {
                    path: '/information/systeminformation',
                    component: resolve => require(['../views/information/systeminformation.vue'], resolve),
                    meta: { title: '系统消息' }
                },
                {
                    path: '/configuration/charge',
                    component: resolve => require(['../views/configuration/charge.vue'], resolve),
                    meta: { title: '保证金和藏品审核费用' }
                },
                {
                    path: '/configuration/address',
                    component: resolve => require(['../views/configuration/address.vue'], resolve),
                    meta: { title: '平台收货地址' }
                },
                {
                    path: '/configuration/addEdit',
                    component: resolve => require(['../views/configuration/addEdit.vue'], resolve),
                    meta: { title: '设置平台收货地址' }
                },
                {
                    path: '/configuration/agreementCN',
                    component: resolve => require(['../views/configuration/agreementCN.vue'], resolve),
                    meta: { title: '用户协议中文' }
                },
                {
                    path: '/configuration/agreementEN',
                    component: resolve => require(['../views/configuration/agreementEN.vue'], resolve),
                    meta: { title: '用户协议英文' }
                },
                {
                    path: '/goods',
                    component: resolve => require(['../views/goods/list.vue'], resolve),
                    meta: { title: '藏品列表' }
                },
                {
                    path: '/goods/details',
                    component: resolve => require(['../views/goods/details.vue'], resolve),
                    meta: { title: '藏品详情' }
                },
                {
                    path: '/goods/recommend',
                    component: resolve => require(['../views/goods/recommend/list.vue'], resolve),
                    meta: { title: '精品推荐' }
                },
                {
                    path: '/goods/weekly',
                    component: resolve => require(['../views/goods/weekly/list.vue'], resolve),
                    meta: { title: '每周精选' }
                },
                {
                    path: '/goods/details',
                    component: resolve => require(['../views/goods/details.vue'], resolve),
                    meta: { title: '藏品详情' }
                },
                {
                    path: '/feedback',
                    component: resolve => require(['../views/feedback/list.vue'], resolve),
                    meta: { title: '意见反馈列表' }
                },

                {
                    path: '/finance/Buytransaction',
                    component: resolve => require(['../views/finance/Buytransaction.vue'], resolve),
                    meta: { title: '购买交易流水列表' }
                },
                {
                    path: '/finance/Reviewflow',
                    component: resolve => require(['../views/finance/Reviewflow.vue'], resolve),
                    meta: { title: '审核交易流水列表' }
                },
                {
                    path: '/finance/Purchasemargin',
                    component: resolve => require(['../views/finance/Purchasemargin.vue'], resolve),
                    meta: { title: '购买保证金交易流水列表' }
                },
                {
                    path: '/finance/Exchangemargin',
                    component: resolve => require(['../views/finance/Exchangemargin.vue'], resolve),
                    meta: { title: '置换保证金交易流水列表' }
                },
                {
                    path: '/withdraw/Cashwithdrawal',
                    component: resolve => require(['../views/withdraw/Cashwithdrawal.vue'], resolve),
                    meta: { title: '提现管理' }
                },
                {
                    path: '/user',
                    component: resolve => require(['../views/user/list.vue'], resolve),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/appVersion',
                    component: resolve => require(['../views/appVersion/list.vue'], resolve),
                    meta: { title: 'APP版本管理' }
                },
                {
                    path: '/adminList',
                    component: resolve => require(['../views/admin/index.vue'], resolve),
                    meta: { title: '管理员账号管理' }
                },
            ]
        },
        // 审核人员
        {
            path: '/check',
            redirect: '/subsection/goodsCheck',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '审核人员菜单' },
            children: [{
                    path: '/subsection/goodsCheck',
                    component: resolve => require(['../views/subsection/goodsCheck/list.vue'], resolve),
                    meta: { title: '藏品发布审核' }
                },{
                    path: '/subsection/details',
                    component: resolve => require(['../views/subsection/goodsCheck/details.vue'], resolve),
                    meta: { title: '藏品详情' }
                },

            ]
        },
        // 交易管理人员
        {
            path: '/staff',
            redirect: '/branch/buy/list',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '交易管理菜单' },
            children: [{
                    path: '/branch/buy/list',
                    component: resolve => require(['../views/branch/buy/list.vue'], resolve),
                    meta: { title: '购买交易列表' }
                },
                {
                    path: '/branch/exchange/list',
                    component: resolve => require(['../views/branch/exchange/list.vue'], resolve),
                    meta: { title: '置换交易列表' }
                },
                {
                    path: '/goods',
                    component: resolve => require(['../views/goods/list.vue'], resolve),
                    meta: { title: '藏品管理' }
                },

            ]
        },
        { path: '/404', component: resolve => require(['../components/page/404.vue'], resolve) },
        { path: '/403', component: resolve => require(['../components/page/403.vue'], resolve) },
        { path: '*', redirect: '/404' }
    ]
})